/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package 解析.node.charproperty;

import 解析.Pattern;
import 解析.node.charproperty.支持补集.Single;

/**
 *
 * @author yanxi
 */
public class Range extends CharProperty {
    public int lower;
    public int upper;
    public Range(int lower, int upper){
        this.lower=lower; 
        this.upper=upper; 
    } 
    @Override
    public boolean isSatisfiedBy (int ch) {
        return Pattern.inRange(lower, ch, upper);
    }
    
    @Override
    public String toString(){ 
        return Single.getSingleString(lower)+"-"+Single.getSingleString(upper);
    }
    
    
}
